CC= g++
CFLAGS=-Wall -O2
LDFLAGS=-Wall -lglut -lm -O2
SDL=-`sdl-config --cflags` `sdl-config --libs` -lSDL

EXEC= risk
TINYXML_DIR= tinyxml/
SRC= $(wildcard *.cpp) $(wildcard $(TINYXML_DIR)*.cpp) 
SRCH= $(wildcard *.h) $(wildcard $(TINYXML_DIR)*.h)
OBJ= $(SRC:.cpp=.o)
BIN_DIR= ./
INCLUDE_DIR= include/

all: $(EXEC) tinyxml

$(EXEC): $(OBJ)
	$(CC) -o $(BIN_DIR)$@ $^ $(LDFLAGS) $(SDL)

%.o: %.cpp $(SRCH)
	$(CC) -I $(INCLUDE_DIR) -o $@ -c $< $(CFLAGS)

clear:
	@rm -rf *.o *~ *.bak $(TINYXML_DIR)*.o

clean: clear
	rm $(BIN_DIR)$(EXEC)
